package com.pay.common.model;

import lombok.Data;
import lombok.ToString;

import java.io.Serializable;

@Data
@ToString(callSuper = true)
public class RespEntity<T> implements Serializable {

    private static final long serialVersionUID = -2644259941898334897L;

    private String status;
    private String code;
    private String error;
    private String msg;
    private T data;

    public RespEntity(){

    }

    public RespEntity(String status){
        this.status = status;
    }

    public RespEntity(String status, String error){
        this.status = status;
        this.error = error;
    }

    public RespEntity(String status, T data){
        this.status = status;
        this.data = data;
    }

    public RespEntity(String status, String error, String msg, T data){
        this.status = status;
        this.error = error;
        this.msg = msg;
        this.data = data;
    }

    public String getStatus() {
        return status;
    }

    public RespEntity<T> setStatus(String status) {
        this.status = status;
        return this;
    }

    public String getError() {
        return error;
    }

    public RespEntity<T> setError(String error) {
        this.error = error;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public RespEntity<T> setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public T getData() {
        return data;
    }

    public RespEntity<T> setData(T data) {
        this.data = data;
        return this;
    }
}

